#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
int my_printf(const char* format, ...)
{
	va_list ap;
	int retval;
	va_start(ap, format);
	printf("my_printf() :");
	retval = vprintf(format, ap);
	va_end(ap);
	return retval;
}

void fscanf_noreturn(FILE* _Stream, const int should_be_value, const char* _Format,  ...)
{
	int _Result;
	va_list _ArgList;
	va_start(_ArgList, _Format);
	_Result = vfscanf(_Stream, _Format, _ArgList);
	va_end(_ArgList);
	if (_Result != should_be_value) { fprintf(stderr, "Error: input format error. Program will exit.\n"); exit(1); }
}

int main()
{
	int i = 150, j = -100;
	double k = 3.14159;
	fscanf_noreturn(stdin, 1, "%d", &i);
	my_printf("%d %f %x\n", j, k, i);
	my_printf("% 2d % *d\n", i, 2, i);
	return 0;
}
